package com.sjtu.util;

import com.sjtu.dao.model.BaseModel;

import java.util.Date;

/**
 * nerine
 * 2/4/2020
 */
public class JpaUtil {
    public static void setModifyInfo(String operateId, BaseModel model) {
        model.setIsDeleted(0);
        Date now = new Date();
        if(model.getCreatedBy() == null) {
            model.setCreatedBy(operateId);
            model.setCreatedDate(now);
        }
        model.setUpdatedBy(operateId);
        model.setUpdatedDate(now);
    }
}
